"use strict";(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([["app_assets_modules_react-code-view_utilities_lines_ts"],{911:(e,t,n)=>{n.d(t,{Gp:()=>h,VT:()=>c,WB:()=>u,e6:()=>d,gt:()=>s});var r=n(74848),i=n(49835),l=n(33535),o=n(96540);let a=(0,o.createContext)({resultsByLineNumber:new i.Es,focusedResult:new i.Lj(void 0)});function s({searchResults:e,focusedSearchResult:t,children:n}){let i=(0,l.R)(),s=(0,l.AI)(void 0!==t?e[t]:void 0);(0,o.useEffect)(()=>{let t=new Map;for(let n of e){let e=n.lineNumber;t.has(e)?t.get(e).push(n):t.set(e,[n])}for(let[e,n]of(i.clear(),t))i.set(e,n)},[i,e]),(0,o.useEffect)(()=>{s.value=void 0!==t?e[t]:void 0},[e,s,t]);let c=(0,o.useMemo)(()=>({resultsByLineNumber:i,focusedResult:s}),[i,s]);return(0,r.jsx)(a.Provider,{value:c,children:n})}function c(){let{resultsByLineNumber:e}=(0,o.useContext)(a);return(0,l.tQ)(e)}function u(e){let{resultsByLineNumber:t}=(0,o.useContext)(a);return(0,l.HN)(t.get(e))}function d(e){let{focusedResult:t}=(0,o.useContext)(a),n=(0,l.Sk)(t,t=>t?.lineNumber===e?t:void 0);return(0,l.HN)(n)}function h(){let{focusedResult:e}=(0,o.useContext)(a);return(0,l.HN)(e)}try{s.displayName||(s.displayName="SearchResultsProvider")}catch{}},4446:(e,t,n)=>{n.d(t,{AG:()=>L,Ay:()=>R,Dp:()=>E});var r=n(74848),i=n(37272),l=n(53552),o=n(80780),a=n(19189),s=n(78314),c=n(25407),u=n(71315),d=n(88431),h=n(96459),f=n(38621),p=n(94236),m=n(5524),g=n(87448),v=n(96540),x=n(40961),y=n(80427),b=n(15668),w=n(68566),C=n(29806);let N="highlighted-line-menu-container",E="highlighted-line-menu-first-option";function L({children:e}){return(0,r.jsxs)("div",{id:w.uU,className:"position-relative",children:[e,(0,r.jsx)("div",{id:N})]})}let j=v.memo(v.forwardRef(_)),R=j;function _({codeLineClassName:e,offset:t,lineData:n,onLineStickOrUnstick:L,onMenuClose:j,onCollapseToggle:R,openOnLoad:_=!1,cursorRef:S,rowBeginId:k,rowBeginNumber:B,rowEndId:O,rowEndNumber:A},$){let[I,T]=(0,v.useState)(null);(0,v.useImperativeHandle)($,()=>({setAnchor:T}));let D=v.useRef(null),{githubDevUrl:M}=(0,l.sq)(),{modelsAccessAllowed:z,refInfo:U,path:F,isMarketplaceEnabled:H}=(0,l.eu)(),P=(0,s.t)(),[W,Y]=(0,v.useState)(_?"hidden":"visible"),[X,G]=(0,v.useState)(void 0);(0,d.N)(()=>{let e=()=>{Y("hidden"),requestAnimationFrame(()=>{G((0,w.sZ)(I,t)),Y("visible")})};return e(),u.cg?.addEventListener("resize",e),()=>{u.cg?.removeEventListener("resize",e)}},[I,t]),(0,d.N)(()=>{if(_){S&&T(S.current);let e=window.setTimeout(()=>{Q(!0)},50);return()=>{window.clearTimeout(e)}}},[]);let{newDiscussionPath:V,newIssuePath:K}=(0,b.Y_)(),{refSelectorShortcut:q}=(0,o.wk)(),[J,Q]=v.useState(!1),{createPermalink:Z,getUrl:ee}=(0,a.Z)(),{setShouldBeOpen:et,expandOrCollapseSection:en,openUpRefSelector:er}=(0,w.S9)({lineData:n,onLineStickOrUnstick:L,onMenuClose:j,onCollapseToggle:R,setOpen:Q}),[ei]=(0,h.o)(),el=Z({absolute:!0,params:"1"===ei.get("plain")?"plain=1":void 0}),eo=encodeURIComponent(el),ea=`L${B}${k!==O?`-L${A}`:""}`,es=void 0===X?null:(0,r.jsxs)(p.W,{open:J,onOpenChange:et,children:[(0,r.jsx)(p.W.Anchor,{children:(0,r.jsx)(g.K0,{className:e,size:"small",icon:f.KebabHorizontalIcon,"aria-label":`Line ${B} options`,"data-testid":"highlighted-line-menu-button",sx:{alignSelf:"center",zIndex:3,position:"absolute",lineHeight:"16px",height:"24px",width:"24px",visibility:W,...X}})}),(0,r.jsx)(p.W.Overlay,{width:"small",children:(0,r.jsxs)(m.l,{"data-testid":"highlighted-line-menu",children:[B===A&&(0,r.jsx)(m.l.Item,{onClick:()=>{(0,C.kY)(`Copied line ${B}.`);let e=(0,w.zM)(u.XC?.getElementById(`LC${B}`)??null);e&&(0,y.D)(e),et(!1)},onSelect:()=>{(0,C.kY)(`Copied line ${B}.`);let e=(0,w.zM)(u.XC?.getElementById(`LC${B}`)??null);e&&(0,y.D)(e),et(!1)},ref:D,className:E,children:"Copy line"}),B!==A&&(0,r.jsx)(m.l.Item,{onClick:()=>{(0,C.kY)(`Copied lines ${B}-${A}.`);let e="";for(let t=B;t<=A;t++)e+=`${(0,w.zM)(u.XC?.getElementById(`LC${t}`)??null)}${t!==A?` `:""}`;e&&(0,y.D)(e),et(!1)},onSelect:()=>{(0,C.kY)(`Copied lines ${B}-${A}.`);let e="";for(let t=B;t<=A;t++)e+=`${(0,w.zM)(u.XC?.getElementById(`LC${t}`)??null)}${t!==A?` `:""}`;e&&(0,y.D)(e),et(!1)},className:E,children:"Copy lines"}),el&&(0,r.jsx)(m.l.Item,{onClick:()=>{(0,C.kY)("Copied permalink."),(0,y.D)(el),et(!1)},onSelect:()=>{(0,C.kY)("Copied permalink."),(0,y.D)(el),et(!1)},children:"Copy permalink"}),(0,r.jsx)(m.l.LinkItem,{href:ee({action:"blame",hash:ea}),children:"View git blame"}),K&&el&&(0,r.jsx)(m.l.LinkItem,{href:`${K}?permalink=${eo}`,children:"Reference in new issue"}),V&&el&&(0,r.jsx)(m.l.LinkItem,{href:`${V}?permalink=${eo}`,children:"Reference in new discussion"}),M&&(0,r.jsx)(m.l.LinkItem,{href:M+u.cg?.location.pathname.substring(1),children:"View file in GitHub.dev"}),B===A&&n&&(0,r.jsxs)(m.l.Item,{onClick:en,onSelect:en,children:[n.ownedSection&&n.ownedSection.collapsed?"Expand":"Collapse"," current section"]}),(0,r.jsxs)(m.l.Item,{onClick:er,onSelect:er,children:["View file in different branch/tag",(0,r.jsx)(m.l.TrailingVisual,{children:(0,r.jsx)(i.E,{children:q.text})})]}),H&&z&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.W.Divider,{}),(0,r.jsxs)(m.l.LinkItem,{href:(0,c.Da2)({registry:"azure-openai",name:"gpt-4o",commit:U.currentOid,filePath:F,repoOwner:P.ownerLogin,repoName:P.name,beginLine:B,endLine:A}),target:"_blank",children:[(0,r.jsx)("p",{className:"mb-1",children:"Open as prompt in GitHub Models"}),(0,r.jsx)(g.EY,{sx:{color:"fg.muted",fontSize:0},children:"This tool uses AI to process your code"})]})]})]})})]}),ec=u.XC?.getElementById(N);return ec?(0,x.createPortal)(es,ec):null}try{L.displayName||(L.displayName="HighlightedLineMenuContainer")}catch{}try{j.displayName||(j.displayName="HighlightedLineMenu")}catch{}try{_.displayName||(_.displayName="HighlightedLineMenuWithRef")}catch{}},5020:(e,t,n)=>{n.d(t,{L:()=>o});var r=n(71315),i=n(96540),l=n(68239);function o(e,t,n,o,a){let s=(0,i.useRef)(null),c=(0,l.pm)(),u=void 0===r.XC,d=(0,l.Px)(),h=(0,i.useMemo)(()=>{let{isEndLine:r,isStartLine:i,lineNumber:l}=e,s=0,c=1,h=r&&!u?new IntersectionObserver(e=>{for(let{target:t,isIntersecting:n,intersectionRatio:r}of e)if(t){let{currentY:e,currentRatio:i}=function(e,t,n,r,i,l,o,a){let s=n.getBoundingClientRect().y,c=i?l(i):void 0,u=window.innerHeight-n.getBoundingClientRect().bottom>0,d=n.getBoundingClientRect().bottom>0,h=n.getBoundingClientRect().top<150,f=u&&d,p=window.innerHeight-n.getBoundingClientRect().bottom>150&&window.innerHeight>300;for(let n of c||[])n&&f&&(st&&o||a(n,!0):s>e&&o&&(r{for(let{target:n,isIntersecting:r,intersectionRatio:i}of t)if(n){let{currentY:t,currentRatio:l}=function(e,t,n,r,i,l,o){let a=r.getBoundingClientRect().y,s=window.innerHeight-r.getBoundingClientRect().bottom>0,c=r.getBoundingClientRect().bottom>0,u=r.getBoundingClientRect().top<150&&r.getBoundingClientRect().top>-300,d=0===r.getBoundingClientRect().bottom&&0===r.getBoundingClientRect().top&&0===r.getBoundingClientRect().height&&0===r.getBoundingClientRect().width&&0===r.getBoundingClientRect().x&&0===r.getBoundingClientRect().y;return!e.ownedSection||e.ownedSection?.collapsed||(a<=t&&(s&&c||u)&&!d?i>n&&l||u&&o(e,!1):a>t&&l&&(i{s.current=e},[]);return(0,i.useEffect)(()=>{let{isStartLine:t,lineNumber:n,ownedSection:r}=e;return t&&s&&r&&h&&!h.hasBeenObserved&&!h.hasBeenDisconnected&&c(r.endLine,{lineNumber:n}),h&&s.current&&!h.hasBeenObserved&&(h.observe(s.current),h.hasBeenObserved=!0),()=>{h&&(h.disconnect(),h.hasBeenDisconnected=!0)}},[h,e]),f}},5625:(e,t,n)=>{n.d(t,{Kn:()=>w,_Y:()=>E,cw:()=>N});var r=n(74848),i=n(6665),l=n(53627),o=n(64830),a=n(88431),s=n(38621),c=n(10095),u=n(87448),d=n(34164),h=n(96540),f=n(60619),p=n(75408),m=n(29806),g=n(87011),v=n(94001),x=n(58150),y=n(4446),b=n(68340);let w=h.memo(C);function C({codeLineData:e,onClick:t,ownedCodeSections:n,onCollapseToggle:s,preventClick:c,onLineStickOrUnstick:u,virtualOffset:w,copilotAccessAllowed:C}){let{lineNumber:L,ownedSection:j,codeLineClassName:R,isStartLine:_,codeownersLineError:S,hiddenUnicode:k}=e,{sendRepoClickEvent:B}=(0,i.T)(),O=(0,p.Jo)(),[A,$]=(0,h.useState)(!1),I=(0,h.useCallback)(e=>{let n,r;if(e.defaultPrevented)return;let i=parseInt(e.currentTarget.getAttribute("data-line-number"),10),o=(0,f.$c)(`L${i}`),a=O.current;if(a&&(a.start.line!==a.end.line||a.start.column!==a.end.column))n=a.start,r=a.end;else{let e=window.getSelection()?.rangeCount?window.getSelection()?.getRangeAt(0):null;e&&(n=(0,m.um)(e.startContainer,e.startOffset),r=(0,m.um)(e.endContainer,e.endOffset))}let s=!1;n&&r&&n.line<=i&&r.line>=i&&(s=!0,o={anchorPrefix:"",blobRange:{start:n,end:r}});let{blobRange:c}=o,u=(0,f.eC)(window.location.hash);u&&e.shiftKey&&!s?(B("BLOB.MULTILINE"),o.blobRange={start:u.start,end:c.end}):B("BLOB.LINE");let d=(0,f.JB)(o);(0,l.Zu)(d),t?.(e)},[t,O,B]),T=(0,b.kT)(L),D=T?.start.line===L,M=T&&T.start.line=L||D&&T?.start.column===null,z=(0,h.useRef)(null),U=(0,h.useRef)(null),F=(0,h.useRef)(null);(0,a.N)(()=>{D&&U.current?.setAnchor(z.current)},[D]);let{codeFoldingOption:H}=(0,o.ud)(),P=H.enabled;(0,h.useEffect)(()=>{!H.enabled&&((0,m.X5)(),s?.(!1),j&&(j.collapsed=!1))},[H.enabled,j,s]);let W=e=>{C&&($(e),setTimeout(()=>F.current?.setAnchor(e?z.current:null),0))};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{ref:z,"data-line-number":L,className:(0,d.$)(R,"react-line-number react-code-text",w&&"virtual",c&&"prevent-click",M&&"highlighted-line"),style:w?{paddingRight:"16px",transform:`translateY(${w}px)`}:{paddingRight:"16px"},onMouseDown:c?void 0:I,onMouseEnter:C?()=>W(!0):void 0,onMouseLeave:C?()=>W(!1):void 0,children:[L,S&&(0,r.jsx)(N,{children:(0,r.jsx)(g.pO,{})}),k&&(0,r.jsx)(N,{children:(0,r.jsx)(v.T4,{})}),P&&_&&j&&n&&(0,r.jsx)(N,{displayRight:!0,children:(0,r.jsx)(E,{codeLineData:e,onCollapseToggle:s,onLineStickOrUnstick:u})})]}),D&&(0,r.jsx)(y.Ay,{codeLineClassName:R,ref:U,rowBeginId:`LG${T.start.line}`,rowBeginNumber:T.start.line,rowEndNumber:T.end.line,rowEndId:`LG${T.end.line}`}),C&&A&&(0,r.jsx)("div",{children:(0,r.jsx)(x.z8,{ref:F,rowBeginNumber:L,rowEndNumber:L,id:"code-line-copilot-button"})})]})}function N({children:e,sx:t,displayRight:n}){return(0,r.jsx)(u.az,{as:"span",sx:{...n?void 0:{left:"-4px"},margin:`1px ${n?"8px":"1px"}`,position:"absolute",zIndex:"1",...t},children:e})}function E({codeLineData:e,onCollapseToggle:t,onLineStickOrUnstick:n}){let i=(0,m.$0)(e.lineNumber),l=(0,h.useCallback)(r=>{let{lineNumber:i,ownedSection:l}=e;l&&(l.collapsed=!1),t?.(!1),(0,m.ny)(i),n?.(e,!0),r.preventDefault()},[e,t,n]),o=(0,h.useCallback)(n=>{let{lineNumber:r,ownedSection:i}=e;i&&(i.collapsed=!0),t?.(!0),(0,m.E8)(r),n.preventDefault()},[e,t]);return i?(0,r.jsx)(u.az,{"aria-label":"Expand code section",onMouseDown:l,role:"button",sx:{position:"absolute"},children:(0,r.jsx)(c.A,{icon:s.ChevronRightIcon})}):(0,r.jsx)(u.az,{"aria-label":"Collapse code section",onMouseDown:o,role:"button",sx:{position:"absolute"},children:(0,r.jsx)(c.A,{icon:s.ChevronDownIcon})})}try{w.displayName||(w.displayName="LineNumber")}catch{}try{C.displayName||(C.displayName="LineNumberUnmemoized")}catch{}try{N.displayName||(N.displayName="CodeAlert")}catch{}try{E.displayName||(E.displayName="CodeFoldingChevron")}catch{}},12918:(e,t,n)=>{n.d(t,{Gx:()=>a});var r,i=n(74848),l=n(21728),o=n(21537);function a(e){return(0,o.Y)(e)?(0,o.t6)(e).map(e=>{let t=o.A0.get(e);return t?`${t}`:e}).join(""):null}try{(r=function(e){let t,n=(0,l.c)(2),{char:r}=e;return n[0]!==r?(t=(0,i.jsx)("span",{className:"hidden-unicode-replacement padded",children:r}),n[0]=r,n[1]=t):t=n[1],t}).displayName||(r.displayName="HiddenUnicodeCharacter")}catch{}},15360:(e,t,n)=>{n.d(t,{y:()=>s});var r=n(6665),i=n(96540),l=n(80427),o=n(25102),a=n(70395);function s(){let{sendRepoClickEvent:e}=(0,r.T)(),{rawBlobUrl:t}=(0,a.A)(),n=(0,i.useRef)(!1);return(0,i.useEffect)(()=>{n.current=navigator.userAgent.toLowerCase().indexOf("firefox")>-1},[]),(0,i.useCallback)(async()=>{e("BLOB_RAW_DROPDOWN.COPY");try{let e=(0,o.Ix)(t);if((0,o.j5)()&&navigator&&navigator.clipboard&&"write"in navigator.clipboard&&!n.current)await navigator.clipboard.write([new ClipboardItem({"text/plain":e})]);else{let t=await e;if(!t)return o.T9.Error;await (0,l.D)(await t.text())}}catch{return o.T9.Error}return o.T9.Success},[n,e,t])}},15668:(e,t,n)=>{n.d(t,{U6:()=>d,Y_:()=>u,mD:()=>c});var r=n(74848),i=n(25407),l=n(96379),o=n(96540);let a={showLicenseMeta:!1,license:null,codeownerInfo:{codeownerPath:null,ownedByCurrentUser:null,ownersForFile:null,ruleForPathLine:null},newDiscussionPath:null,newIssuePath:null},s=o.createContext(a);function c({children:e,...t}){return(0,r.jsx)(s.Provider,{value:t,children:e})}function u(){return o.useContext(s)}function d(e,t,n,r){let[s,c]=(0,o.useState)(a),u=t&&!r?(0,i.ALm)({repo:e,commitish:t.name,path:n}):null;return(0,o.useEffect)(()=>{if(!u)return;let e=!1;return(async()=>{c(a);let t=await (0,l.lS)(u);if(!e)try{if(t.ok){let e=await t.json();e&&"boolean"==typeof e.showLicenseMeta&&"object"==typeof e.codeownerInfo&&c(e)}else c(a)}catch{c(a)}})(),function(){e=!0}},[u]),s}try{s.displayName||(s.displayName="DeferredMetadataContext")}catch{}try{c.displayName||(c.displayName="DeferredMetadataProvider")}catch{}},18666:(e,t,n)=>{n.d(t,{n:()=>f});var r=n(74848),i=n(88431),l=n(91359),o=n(87448),a=n(96540),s=n(70395),c=n(96657),u=n(29806),d=n(58150),h=n(68340);function f({linesData:e,copilotAccessAllowed:t}){let n=(0,h.Df)(),{tabSize:o}=(0,s.A)(),f=(0,c.o)("react-line-numbers"),m=(0,l.Y)(),g=(0,a.useRef)(null),v=(0,a.useRef)(null),x=n?(0,u.N9)(n.start.line,e):0,y=n?.end.line?(0,u.N9)(n.end.line,e):x,[b,w]=(0,a.useState)(m?x*f-3:x*f);if((0,i.N)(()=>{n&&(v.current?.setAnchor(g.current),w(m?x*f-3:x*f))},[n,m,f,x]),!n)return null;let C=[];for(let t=x;t<=y;t++){let r=(0,u.zS)("",t+1);if(!r)continue;let i=(0,u.jH)(n,r,t+1,o,e[t+1]?.rawText??"")??{};C.push({position:i,lineNumber:t})}return(0,r.jsxs)("div",{ref:g,style:{position:"relative",top:b+10},children:[C.map(({position:e,lineNumber:t})=>(0,r.jsx)(p,{highlightPosition:e,lineNumber:t,startingLineNumber:x},`line-${t}-highlight-${e.offset}`)),t&&(0,r.jsx)(d.z8,{ref:v,rowBeginNumber:n.start.line,rowEndNumber:n.end.line,recalcPosition:b,id:"code-line-copilot-button"})]})}function p({startingLineNumber:e,lineNumber:t,highlightPosition:n,subtle:i}){let l=(0,c.o)("react-line-numbers"),a=(t-e)*l;return(0,r.jsx)(o.az,{className:"line-highlight",sx:{position:"absolute",backgroundColor:i?"neutral.subtle":"var(--bgColor-attention-muted, var(--color-attention-subtle))",height:l,opacity:".6",boxShadow:i?"inset 2px 0 0 var(--borderColor-neutral-emphasis, var(--color-fg-subtle))":"inset 2px 0 0 var(--bgColor-attention-emphasis, var(--color-attention-fg))",left:n&&n.offset?`${n.offset-10}px`:"-82px",top:`${a-10}px`,width:n&&n.width?`${n.width+82}px`:"calc(100% + 82px)",pointerEvents:"none"}},`highlighted-line-${t}`)}try{f.displayName||(f.displayName="HighlightedLinesOverlay")}catch{}try{p.displayName||(p.displayName="LineHighlight")}catch{}},19973:(e,t,n)=>{n.d(t,{M:()=>u,U:()=>c});var r=n(74848),i=n(38621),l=n(87448),o=n(96657),a=n(29806),s=n(68657);function c({linesData:e,onLineStickOrUnstick:t,setIsCollapsed:n,tabSize:i,extraLeftPadding:c,contentWidth:d}){let h=[...(0,a.bP)().keys()],f=(0,o.o)("react-line-numbers");return(0,r.jsx)(r.Fragment,{children:h.map(o=>{let h=(0,a.N9)(o,e);if(void 0===h||e[h]?.ownedSection===void 0)return null;let p=e[h],m=(0,a.m)(p?.rawText?.length??0,p?.rawText??"",i);return(0,r.jsxs)(l.az,{sx:{position:"absolute",top:f*h,pl:"10px",height:f,whiteSpace:"pre"},children:[d?(0,r.jsx)(s.I,{subtle:!0,lineNumber:o,highlightPosition:{offset:-82,width:d}}):null,(0,r.jsx)(u,{codeLineData:p,setIsCollapsed:n,onLineStickOrUnstick:t,leftOffset:m+(c??0)})]},`expand-row-ellipsis-${o}`)})})}function u({codeLineData:e,leftOffset:t,setIsCollapsed:n,onLineStickOrUnstick:l}){let{lineNumber:o,ownedSection:s}=e;return(0,a.$0)(o)?(0,r.jsx)("button",{"aria-label":"Expand row",className:"Button Button--iconOnly Button--invisible Button--small px-2 py-0 ml-1 border-0 expand-row-ellipsis",style:{left:t},onMouseDown:t=>{(0,a.ny)(o),n?.(!1),s&&(s.collapsed=!1,l?.(e,!0)),t.preventDefault()},children:(0,r.jsx)(i.EllipsisIcon,{})}):null}try{c.displayName||(c.displayName="CodeFoldingEllipsisOverlay")}catch{}try{u.displayName||(u.displayName="ExpandRowEllipsis")}catch{}},21537:(e,t,n)=>{n.d(t,{A0:()=>o,TA:()=>c,Y:()=>u,_n:()=>d,rE:()=>a,t6:()=>s});let r=/[\u202A-\u202E]|[\u2066-\u2069]|\u{E0001}|\u{E007F}/u,i=/[\u202A-\u202E]|[\u2066-\u2069]|\u{E0001}|\u{E007F}/gu,l=/([\u202A-\u202E]|[\u2066-\u2069]|\u{E0001}|\u{E007F})/gu,o=new Map(Object.entries({"\u202A":"U+202A","\u202B":"U+202B","\u202C":"U+202C","\u202D":"U+202D","\u202E":"U+202E","\u2066":"U+2066","\u2067":"U+2067","\u2068":"U+2068","\u2069":"U+2069","\u{E0001}":"U+E0001","\u{E007F}":"U+E007F"}));function a(e){return``}function s(e){return e.split(l)}function c(e){return u(e)?e.replaceAll(i,e=>o.get(e)??""):e}function u(e){return r.test(e)}function d(e){return o.get(e)}},25014:(e,t,n)=>{n.d(t,{FL:()=>y,Ru:()=>C,_x:()=>w});var r=n(74848),i=n(64830),l=n(87448),o=n(96540),a=n(77031),s=n(75408),c=n(29806),u=n(30022),d=n(19973),h=n(68657),f=n(51220),p=n(38943),m=n(96657);function g(e){window.scrollTo({top:e,left:0})}function v(e,t){return Array(t-e).fill(null).map((t,n)=>n+e)}var x=n(5625);let y=o.memo(o.forwardRef(b));function b({linesData:e,onLineNumberClick:t,codeSections:n,codeLineToSectionMap:y,onLineStickOrUnstick:b,tabSize:N,contentWidth:E,onCollapseToggle:L,cursorContainerRef:j,textAreaRef:R,materializeAllLines:_,copilotAccessAllowed:S},k){let B=(0,o.useRef)(null),O=(0,o.useRef)(null),A=(0,o.useRef)(null),$=(0,s.fY)(),I=(0,o.useRef)(!0),T=(0,o.useRef)(!0),D=(0,o.useRef)(!0),{stylingDirectives:M}=(0,a.PL)();(0,o.useEffect)(()=>{if(R&&R.current){R.current.onscroll=()=>{if(O.current&&R?.current){if(!D.current){D.current=!0;return}if(R.current.scrollLeft===O.current.scrollLeft)return;I.current=!(T.current&&D.current),O.current.scrollLeft=R.current.scrollLeft}j&&j.current&&R?.current&&(j.current.scrollLeft=R.current.scrollLeft)};let e=R.current;return()=>{e&&(e.onscroll=null)}}},[R,B,$,j]);let z=(0,i.ud)().codeWrappingOption.enabled,U=(0,c.Gb)(),F=function({lineCount:e,materializeAllLines:t}){let n=(0,m.o)("react-line-numbers"),r=(0,o.useMemo)(()=>()=>n,[n]),i=(0,o.useMemo)(()=>{var t;return t=e,function(e){if(t<150)return v(0,t);let n=(0,p.vp)(e);if(0===n.length)return n;let r=n[0],i=Math.min(75,t-n[n.length-1]),l=v(0,Math.min(75,r)),o=v(t+1-i,t);return l.concat(n,o)}},[e]);return(0,f.XW)({count:e,overscan:t?Number.MAX_SAFE_INTEGER:100,estimateSize:r,rangeExtractor:i,scrollToFn:g,measureElement:"undefined"!=typeof window&&"undefined"!=typeof document&&window.navigator?.userAgent?e=>e?.getBoundingClientRect().height:void 0})}({parentRef:B,lineCount:e.length,materializeAllLines:!!_});(0,o.useEffect)(()=>{F.measure()},[z,F]),(0,o.useImperativeHandle)(k,()=>({scrollToTop:()=>{(0,c.si)(0)||F.scrollToIndex(0,{align:"start"})},scrollToLine:(e,t)=>{F.scrollToIndex(e,{align:"start"});let n=B.current;n&&n.scroll({left:C(n,e,t)})}}));let H=$?{overflowX:"overlay",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}:{overflowX:"auto"};return(0,r.jsxs)(l.az,{ref:B,sx:{pointerEvents:$?"none":"auto"},onScroll:e=>w(e,R),children:[(0,r.jsx)(l.az,{className:"react-code-line-container",ref:O,sx:H,tabIndex:0,onScroll:()=>{if($&&O.current&&A.current){if(!T.current){T.current=!0;return}A.current.scrollLeft!==O.current.scrollLeft&&(D.current=!(T.current&&I.current),A.current.scrollLeft=O.current.scrollLeft)}},children:(0,r.jsxs)(l.az,{className:"react-code-file-contents",role:"presentation","aria-hidden":!0,"data-tab-size":N,"data-testid":"code-lines-container","data-paste-markdown-skip":!0,sx:{tabSize:N,position:"relative",width:E,maxWidth:z?"100%":"unset"},style:{height:F.getTotalSize()},"data-hpc":!0,children:[(0,r.jsx)("div",{className:"react-line-numbers",style:{pointerEvents:"auto",height:F.getTotalSize(),position:"relative",zIndex:2},children:F.getVirtualItems().map(i=>{let l=e[i.index];return(0,r.jsx)(x.Kn,{codeLineData:l,onClick:t,ownedCodeSections:n,onLineStickOrUnstick:b,onCollapseToggle:L,virtualOffset:i.start,copilotAccessAllowed:S},`line-number-${l.lineNumber}-content:${l.rawText?.substring(0,100)}`)})}),(0,r.jsx)("div",{className:"react-code-lines",style:{height:F.getTotalSize()},children:F.getVirtualItems().map(t=>{let n=e[t.index];return(0,r.jsx)(h.S,{codeLineData:n,stylingDirectivesLine:n.stylingDirectivesLine??(M?M[n.lineNumber-1]:void 0),shouldUseInert:U,codeLineClassName:n.codeLineClassName,id:`LC${n.lineNumber}`,onLineStickOrUnstick:b,setIsCollapsed:L,codeLineToSectionMap:y,virtualOffset:t.start,virtualKey:String(t.key),copilotAccessAllowed:S,measureRef:z?F.measureElement:void 0,virtualIndex:z?t.index:void 0},`line-number-${n.lineNumber}-content:${n.rawText?.substring(0,100)}`)})}),(0,r.jsx)(u.A,{shouldNotOverrideCopy:$,containerRef:$?R:B}),!z&&(0,r.jsx)(d.U,{linesData:e,onLineStickOrUnstick:b,setIsCollapsed:L,tabSize:N,extraLeftPadding:82})]})}),$&&E&&O.current&&O.current.clientWidth{if(A.current&&R?.current){if(!I.current){I.current=!0;return}A.current.scrollLeft!==R.current.scrollLeft&&(T.current=!(D.current&&I.current),R.current.scrollLeft=A.current.scrollLeft)}},ref:A,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onMouseUp:e=>e.preventDefault(),children:(0,r.jsx)(l.az,{sx:{width:E,height:"1px"}})}):null]})}function w(e,t){let n=e.target;t?.current?.scrollTo(n.scrollLeft,n.scrollTop)}function C(e,t,n){if(!n)return 0;let r=(0,c.a2)(t,n);if(!r)return 0;let i=e.getBoundingClientRect(),l=r.getBoundingClientRect();return i.left+i.width-e.scrollLeft-(l.left+l.width)>0?0:r.offsetLeft}try{y.displayName||(y.displayName="CodeLines")}catch{}try{b.displayName||(b.displayName="CodeLinesUnmemoized")}catch{}},25102:(e,t,n)=>{n.d(t,{Ix:()=>c,T9:()=>a,j5:()=>s,t0:()=>u});var r=n(74848),i=n(38621),l=n(69726),o=n(10095);let a={Idle:"Idle",Fetching:"Fetching",Success:"Success",Error:"Error"};function s(){let e="undefined"!=typeof ClipboardItem;return"clipboard"in navigator&&e}async function c(e){let t=await fetch(e,{method:"get"});if(!t.ok)throw Error(`Failed to fetch ${e}: ${t.status} ${t.statusText}`);return new Blob([(await t.text()).replace(/\r?\n$/,"")],{type:"text/plain"})}function u(e){let t,n;switch(e){case a.Success:t="Copied!",n=(0,r.jsx)(o.A,{icon:i.CheckIcon});break;case a.Fetching:t="Copying",n=(0,r.jsx)(l.A,{size:"small"});break;case a.Error:t="Something went wrong. Try again.",n=(0,r.jsx)(o.A,{icon:i.AlertIcon});break;default:t="Copy",n=(0,r.jsx)(o.A,{icon:i.CopyIcon})}return{ariaLabel:t,content:n}}},27473:(e,t,n)=>{n.d(t,{M:()=>l});let r=(e,t)=>e[({start:0,end:1,cssClass:2})[t]],i=e=>Array.isArray(e)?{s:r(e,"start"),e:r(e,"end"),c:r(e,"cssClass")}:e,l=e=>0===e.length?[]:Array.isArray(e[0])?e.map(i):e},29110:(e,t,n)=>{n.d(t,{u:()=>i});var r=n(96540);function i(){let[e,t]=(0,r.useState)({});return(0,r.useCallback)(()=>t({}),[])}},29806:(e,t,n)=>{n.d(t,{$0:()=>m,Bm:()=>R,Bn:()=>b,CZ:()=>C,E8:()=>E,Gb:()=>x,N9:()=>$,Wb:()=>g,X5:()=>L,a2:()=>f,ap:()=>O,bP:()=>v,hO:()=>y,jH:()=>k,kY:()=>I,m:()=>S,ny:()=>N,si:()=>B,t1:()=>A,um:()=>_,wQ:()=>d,zS:()=>h});var r=n(49835),i=n(33535),l=n(71315),o=n(96540),a=n(60619),s=n(56677),c=n(75408);let u="collapse-show-rows-styles",d="read-only-cursor-text-area";function h(e,t){return document.querySelector(`#${e}LC${t}`)}function f(e,t){return document.querySelector(`main #${(0,s.p)(e,t)}`)}let p=new r.yy;function m(e){return(0,i.HN)(p.has(e))}function g(e){return(0,i.Rs)(p,e)}function v(){return(0,i.tQ)(p)}function x(){let e=y(),t=(0,o.useSyncExternalStore)(()=>()=>{},()=>(function(e){let t=e.toLowerCase().match(/firefox\/(\d+(\.\d+)?)/);return t&&t.length>=2&&t[1]?parseFloat(t[1]):null})(navigator.userAgent),()=>null)??0,n=(0,o.useSyncExternalStore)(()=>()=>{},()=>navigator.userAgent.toLowerCase().indexOf("chrome")>-1||navigator.userAgent.toLowerCase().indexOf("chromium")>-1||navigator.userAgent.toLowerCase().indexOf("edge")>-1,()=>!1),r=(0,o.useSyncExternalStore)(()=>()=>{},()=>(function(e){let t=e.match(/Chrom(e|ium)\/([0-9]+)\./);return t&&t.length>=3&&t[2]?parseFloat(t[2]):null})(navigator.userAgent),()=>null)??0;return(0,c.fY)()&&(e||n)&&(t>=124||r>=124)}function y(){return(0,o.useSyncExternalStore)(()=>()=>{},()=>navigator.userAgent.toLowerCase().indexOf("firefox")>-1,()=>!1)}function b(e,t,n,r){if(!r)return"";let i="";for(let t=0;te.lineNumber&&r(e,!1)}}function N(e){j(e,!1),p.delete(e)}function E(e){j(e,!0),p.add(e)}function L(){let e=document.getElementById(u);e&&(e.textContent=""),p.clear()}function j(e,t){let n=`.${w(e-1)} { display: none; } `;if(document.getElementById(u)){let e=document.getElementById(u);if(t)e.textContent+=n;else{let t=e?.textContent||"";e.textContent=t=t.replace(n,"")}}else{let e=document.createElement("style");e.id=u,e.textContent=n,document.head.appendChild(e)}}function R(e,t){if(e.length<3)return!1;let n=t.split(" "),r=n.includes("pl-ent")?/\n|\s|[();&.=,]/:/\n|\s|[();&.=",]/;return!(e.match(r)||n.includes("pl-c")||n.includes("pl-k"))}function _(e,t){let n=null,r=null,i=null,l=t;if(e.parentElement?.classList.contains("react-file-line"))n=e.parentElement.getAttribute("data-line-number"),r=e.parentElement,i=e;else if(e.parentElement?.parentElement?.classList.contains("react-file-line"))n=e.parentElement.parentElement.getAttribute("data-line-number"),r=e.parentElement.parentElement,i=e.parentNode;else{if(!e.parentElement?.firstElementChild?.classList.contains("react-file-line")||!(n=e.parentElement.firstElementChild.getAttribute("data-line-number"))||!parseInt(n,10))return;return{line:parseInt(n,10)-1,column:null}}if(n&&parseInt(n,10)){for(let e of r.childNodes){if(e===i)break;l+=e.textContent?.length||0}return{line:parseInt(n,10),column:0!==l?l+1:null}}}function S(e,t,n){let r=document.createElement("div");r.style.position="absolute",r.style.visibility="hidden",r.style.fontFamily="var(--fontStack-monospace)",r.style.fontSize="12px",r.style.lineHeight="20px",r.style.whiteSpace="pre",r.style.tabSize=n.toString(),r.textContent=t.slice(0,e),document.body.appendChild(r);let i=r.clientWidth;return(document.body.removeChild(r),0===i&&0!==e)?e*c.QM:i}function k(e,t,n,r,i){if(e?.start.line===n&&e?.start.column!==null){let l=(0,a.Py)({start:e.start,end:{line:e.start.line,column:e.end.line===n?e.end.column:null}},()=>t);if(l&&l.startContainer.parentElement)return{offset:l?.getBoundingClientRect().x-t.getBoundingClientRect().x+10,width:e.end.line===n?l.getBoundingClientRect().width:void 0};if(i){let t=S(e.start.column-1,i,r),l=e.end.line===n?e.end.column:null;return{offset:t+20,width:e.end.line===n?S(l?l-1:i.length-1,i,r)-t:void 0}}}else if(e?.end.line===n&&e?.end.column!==null){let n=(0,a.Py)({start:{line:e.end.line,column:0},end:e.end},()=>t);return n?{width:n.getBoundingClientRect().width+10}:{width:S(e.end.column-1,i,r)+10}}}function B(e){var t=h("",e);if(!t)return!1;let n=t.getBoundingClientRect();return n.top>=0&&n.left>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)}function O(e){return h("",e)}function A(e,t,n){return Math.floor((e-t)/n)+1}function $(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=Math.floor((n+r)/2),l=t[i];if(!l)break;if(l.lineNumber===e)return i;l.lineNumber{n&&(n.textContent=r)},t)}},30022:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(74848),i=n(80780),l=n(96540),o=n(15360);function a({containerRef:e,shouldNotOverrideCopy:t}){let{selectAllShortcut:n}=(0,i.wk)(),a=(0,l.useRef)(!1),s=(0,o.y)(),c=(0,l.useCallback)(()=>{a.current=!1,document.removeEventListener("selectionchange",c)},[]);(0,l.useEffect)(()=>()=>document.removeEventListener("selectionchange",c),[c]);let u=(0,l.useCallback)(t=>{e&&e.current&&(function(e){let t=document.createRange();t.selectNode(e);let n=window.getSelection();n?.removeAllRanges(),n?.addRange(t)}(e.current),t.preventDefault(),a.current=!0,setTimeout(()=>document.addEventListener("selectionchange",c),0))},[e,c]),d=(0,l.useCallback)(e=>{a.current&&(e.preventDefault(),s())},[s]);return(0,l.useEffect)(()=>{if(!t)return window.addEventListener("copy",d),()=>window.removeEventListener("copy",d)},[d,t]),(0,r.jsx)("button",{hidden:!0,"data-hotkey":n.hotkey,onClick:u})}try{a.displayName||(a.displayName="SelectAllShortcutButton")}catch{}},33535:(e,t,n)=>{n.d(t,{AI:()=>l,HN:()=>u,R:()=>a,Rs:()=>c,Sk:()=>h,XG:()=>o,tQ:()=>d});var r=n(96540),i=n(49835);function l(e){let[t]=(0,r.useState)(()=>new i.Lj(e));return t}function o(e){let t=(0,r.useRef)(null);null===t.current&&(t.current=new i.Lj(e));let n=(0,r.useCallback)(e=>{null!==t.current&&(t.current.value=e)},[]);return[t,n]}function a(...e){let[t]=(0,r.useState)(()=>new i.Es(...e));return t}let s=Symbol("no value");function c(e,t){let n=(0,r.useRef)(e.value),i=(0,r.useRef)(t);(0,r.useEffect)(()=>{i.current=t}),(0,r.useEffect)(()=>(n.current!==s&&n.current!==e.value&&(i.current(e.value),n.current=s),e.subscribe(e=>i.current(e))),[e])}function u(e){let[t,n]=(0,r.useState)(e.value);return c(e,e=>n(e)),t}function d(e){let[t,n]=(0,r.useState)(e.value),[i,l]=(0,r.useState)({});return c(e,e=>{n(e),l({})}),t}function h(e,t){let n=l(t(e.value));return c(e,e=>{n.value=t(e)}),n}},39619:(e,t,n)=>{n.d(t,{HS:()=>o,Oc:()=>l,Tv:()=>c,Xr:()=>SymbolChangedEvent,f7:()=>a,fD:()=>s,qR:()=>i});var r=n(50467);let OpenCopilotChatEvent=class OpenCopilotChatEvent extends Event{constructor(e){super("open-copilot-chat",{bubbles:!1,cancelable:!0}),(0,r._)(this,"payload",void 0),this.payload=e}};Event;let AddCopilotChatReferenceEvent=class AddCopilotChatReferenceEvent extends Event{constructor(e,t=!1,n){super("add-copilot-chat-reference",{bubbles:!1,cancelable:!0}),(0,r._)(this,"reference",void 0),(0,r._)(this,"openPanel",void 0),(0,r._)(this,"id",void 0),this.reference=e,this.openPanel=t,this.id=n}};let SymbolChangedEvent=class SymbolChangedEvent extends Event{constructor(e){super("symbol-changed",{bubbles:!1,cancelable:!0}),(0,r._)(this,"context",void 0),this.context=e}};function i(e){window.dispatchEvent(new OpenCopilotChatEvent(e))}function l(e,t=!1,n){window.dispatchEvent(new AddCopilotChatReferenceEvent(e,t,n))}function o(e){return window.addEventListener("open-copilot-chat",e),()=>{window.removeEventListener("open-copilot-chat",e)}}function a(e){return window.addEventListener("add-copilot-chat-reference",e),()=>{window.removeEventListener("add-copilot-chat-reference",e)}}function s(e){return window.addEventListener("search-copilot-chat",e),()=>{window.removeEventListener("search-copilot-chat",e)}}function c(e){return window.addEventListener("symbol-changed",e),()=>{window.removeEventListener("symbol-changed",e)}}},44314:(e,t,n)=>{n.d(t,{P9:()=>E,OL:()=>j,kd:()=>L,G:()=>_});var r=n(74848),i=n(91747),l=n(64830),o=n(87448),a=n(96540),s=n(96657),c=n(75408),u=n(29110),d=n(29806),h=n(30022),f=n(19973),p=n(25014),m=n(18666),g=n(48064),v=n(57555),x=n(73189),y=n(5020),b=n(80166);function w({linesData:e,onLineStickOrUnstick:t,codeLineToSectionMap:n}){let i=(0,b.ds)(),l=(0,s.o)("react-line-numbers");return void 0===n?null:(0,r.jsx)(r.Fragment,{children:e.map(o=>{let a=o.lineNumber,s=n?.get(a)?.length??0;if(void 0===a||void 0===o.ownedSection)return null;let c=(0,d.N9)(a,e);return(0,r.jsx)(C,{className:"symbol-highlight react-code-text",lineData:e[c],stickyHeaderHeight:i,numParents:s,onLineStickOrUnstick:t??x.l,sx:{position:"absolute",top:l*(c-1),pl:"10px",height:l,whiteSpace:"pre"}},`observer-overlay-${c}-lineNumber-no-virtualization`)})})}function C({lineData:e,onLineStickOrUnstick:t,numParents:n,stickyHeaderHeight:i,className:l,sx:a}){let s=(0,y.L)(e,!0,i,t,n);return(0,r.jsx)(o.az,{ref:e=>{s(e)},className:l,sx:{mb:"-20px",color:"transparent",position:"absolute",maxHeight:"6rem",overflow:"hidden",width:"100%",display:"inline-block",userSelect:"none",...a},"data-testid":"sticky-line-observer"})}try{w.displayName||(w.displayName="StickyLineObserverOverlay")}catch{}try{C.displayName||(C.displayName="StickyLineObserverLine")}catch{}var N=n(57472);let E=a.memo(a.forwardRef(R)),L=60,j=3500;function R({linesData:e,onLineNumberClick:t,codeSections:n,nonTruncatedLinesData:i,codeLineToSectionMap:l,onLineStickOrUnstick:x,colorizedLines:y,tabSize:b,contentWidth:C,cursorContainerRef:E,onCollapseToggle:j,textAreaRef:R,copilotAccessAllowed:_},S){let k=(0,a.useRef)(null),B=(0,a.useRef)(null),O=(0,a.useRef)(null),A=(0,c.fY)(),$=(0,u.u)(),I=(0,a.useRef)(!0),T=(0,a.useRef)(!0),D=(0,a.useRef)(!0),M=(0,s.o)("react-line-numbers"),z=(0,a.useRef)([...Array(Math.floor(e.length/L)+1).keys()]);(0,a.useImperativeHandle)(S,()=>({scrollToTop:()=>{(0,d.si)(0)||window.scrollTo({left:0,top:0})},scrollToLine:(e,t)=>{let n=k.current;n&&setTimeout(()=>window.scrollTo({left:(0,p.Ru)(n,e,t),top:M*e}),0)}})),(0,a.useEffect)(()=>{if(R&&R.current){R.current.onscroll=()=>{if(B.current&&R?.current){if(!D.current){D.current=!0;return}if(R.current.scrollLeft===B.current.scrollLeft)return;I.current=!(T.current&&D.current),B.current.scrollLeft=R.current.scrollLeft}E&&E.current&&R?.current&&(E.current.scrollLeft=R.current.scrollLeft)};let e=R.current;return()=>{e&&(e.onscroll=null)}}},[R,k,A,E]),(0,a.useEffect)(()=>{z.current=[...Array(Math.floor(e.length/L)+1).keys()],$()},[e]);let U=A?{overflowX:"overlay",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}:{overflowX:"auto"};return(0,r.jsxs)(o.az,{ref:k,sx:{pointerEvents:A?"none":"auto"},onScroll:e=>(0,p._x)(e,R),children:[(0,r.jsx)(o.az,{ref:B,sx:U,tabIndex:0,onScroll:()=>{if(A&&B.current&&O.current){if(!T.current){T.current=!0;return}O.current.scrollLeft!==B.current.scrollLeft&&(D.current=!(T.current&&I.current),O.current.scrollLeft=B.current.scrollLeft)}},children:(0,r.jsxs)(o.az,{className:"react-code-file-contents",role:"presentation","aria-hidden":!0,"data-tab-size":b,"data-paste-markdown-skip":!0,sx:{tabSize:b,position:"relative",width:C,maxWidth:"unset"},"data-hpc":!0,children:[(0,r.jsx)("div",{className:"react-line-numbers-no-virtualization",style:{pointerEvents:"auto",position:"relative",zIndex:2},children:z.current.map(i=>{let o=e.slice(i*L,Math.min(i*L+L,e.length));return(0,r.jsx)("div",{className:"react-no-virtualization-wrapper-lines",children:o.map(e=>(0,r.jsx)(v.m,{codeLineData:e,onClick:t,ownedCodeSections:n,onLineStickOrUnstick:x,onCollapseToggle:j,codeLineToSectionMap:l,copilotAccessAllowed:_},`line-number-${e.lineNumber}-content:${e.rawText?.substring(0,100)}`))},`line-number-wrapper-${i}-content:${o[0]?.rawText?.substring(0,100)}`)})}),(0,r.jsxs)("div",{className:"react-code-lines",children:[(0,r.jsx)(g.R,{linesData:e}),(0,r.jsx)(m.n,{linesData:e,copilotAccessAllowed:_}),(0,r.jsx)(N.Bg,{colorizedLines:y,linesData:i}),(0,r.jsx)(w,{linesData:e,onLineStickOrUnstick:x,codeLineToSectionMap:l}),(0,r.jsx)(f.U,{linesData:e,onLineStickOrUnstick:x,setIsCollapsed:j,tabSize:b,contentWidth:C})]}),(0,r.jsx)(h.A,{shouldNotOverrideCopy:A,containerRef:A?R:k})]})}),A&&C&&B.current&&B.current.clientWidth{if(O.current&&R?.current){if(!I.current){I.current=!0;return}O.current.scrollLeft!==R.current.scrollLeft&&(T.current=!(D.current&&I.current),R.current.scrollLeft=O.current.scrollLeft)}},ref:O,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onMouseUp:e=>e.preventDefault(),children:(0,r.jsx)(o.az,{sx:{width:C,height:"1px"}})}):null]})}function _(e){let t=(0,l.ud)().codeWrappingOption.enabled,n=(0,i.u)("react_blob_overlay"),r=(0,d.Gb)(),o=(0,d.hO)();return n&&!t&&!(o&&!r)&&e{n.d(t,{R:()=>s});var r=n(74848),i=n(96657),l=n(29806),o=n(56677),a=n(911);function s({linesData:e}){let t=(0,a.VT)(),n=(0,a.Gp)(),s=(0,i.o)("react-line-numbers");return(0,r.jsx)(r.Fragment,{children:[...t.values()].map(t=>{let i=t[0]?.lineNumber;if(void 0===i)return null;let a=(0,l.N9)(i,e)+1;return(0,r.jsx)(o.U,{className:"symbol-highlight react-code-text",lineNumber:a,symbols:t,focusedSymbol:n,sx:{position:"absolute",top:s*(a-1),pl:"10px",height:s,whiteSpace:"pre"}},`overlay-${a}-lineNumber-no-virtualization`)})})}try{s.displayName||(s.displayName="HighlightedSymbolsOverlay")}catch{}},49835:(e,t,n)=>{n.d(t,{Es:()=>ObservableMap,Lj:()=>ObservableValue,yy:()=>ObservableSet});var r=n(35750),i=n(18150),l=n(85242),o=new WeakMap;let a=class ObservableBase{subscribe(e){return(0,r._)(this,o).add(e),()=>{(0,r._)(this,o).delete(e)}}notify(e){for(let t of(0,r._)(this,o))t(e)}constructor(){(0,i._)(this,o,{writable:!0,value:new Set})}};var s=new WeakMap;let ObservableValue=class ObservableValue extends a{get value(){return(0,r._)(this,s)}set value(e){var t,n;t=(0,r._)(this,s),("object"==typeof(n=e)&&n&&"object"==typeof t&&t?function(e,t){for(let n of new Set(Object.keys(e).concat(Object.keys(t))))if(!Object.is(e[n],t[n]))return!0;return!1}(t,n):!Object.is(t,n))&&((0,l._)(this,s,e),this.notify(e))}setValue(e){this.value=e}constructor(e){super(),(0,i._)(this,s,{writable:!0,value:void 0}),(0,l._)(this,s,e)}};var c=new WeakMap,u=new WeakMap;let ObservableSet=class ObservableSet extends a{get value(){return(0,r._)(this,c)}has(e){if(!(0,r._)(this,u).has(e)){let t=new ObservableValue((0,r._)(this,c).has(e));(0,r._)(this,u).set(e,t)}return(0,r._)(this,u).get(e)}add(e){(0,r._)(this,c).has(e)||((0,r._)(this,c).add(e),(0,r._)(this,u).has(e)&&((0,r._)(this,u).get(e).value=!0),this.notify((0,r._)(this,c)))}delete(e){(0,r._)(this,c).has(e)&&((0,r._)(this,c).delete(e),(0,r._)(this,u).has(e)&&((0,r._)(this,u).get(e).value=!1),this.notify((0,r._)(this,c)))}clear(){if(0!==(0,r._)(this,c).size){for(let e of((0,r._)(this,c).clear(),(0,r._)(this,u).values()))e.value=!1;this.notify((0,r._)(this,c))}}constructor(...e){super(),(0,i._)(this,c,{writable:!0,value:void 0}),(0,i._)(this,u,{writable:!0,value:new Map}),(0,l._)(this,c,new Set(...e))}};var d=new WeakMap,h=new WeakMap,f=new WeakMap;let ObservableMap=class ObservableMap extends a{get value(){return(0,r._)(this,d)}has(e){if(!(0,r._)(this,h).has(e)){let t=new ObservableValue((0,r._)(this,d).has(e));(0,r._)(this,h).set(e,t)}return(0,r._)(this,h).get(e)}get(e){if(!(0,r._)(this,f).has(e)){let t=new ObservableValue((0,r._)(this,d).get(e));(0,r._)(this,f).set(e,t)}return(0,r._)(this,f).get(e)}set(e,t){(0,r._)(this,d).get(e)!==t&&((0,r._)(this,d).set(e,t),(0,r._)(this,h).has(e)&&((0,r._)(this,h).get(e).value=!0),(0,r._)(this,f).has(e)&&((0,r._)(this,f).get(e).value=t),this.notify((0,r._)(this,d)))}delete(e){(0,r._)(this,d).has(e)&&((0,r._)(this,d).delete(e),(0,r._)(this,h).has(e)&&((0,r._)(this,h).get(e).value=!1),(0,r._)(this,f).has(e)&&((0,r._)(this,f).get(e).value=void 0),this.notify((0,r._)(this,d)))}clear(){if(0!==(0,r._)(this,d).size){for(let e of((0,r._)(this,d).clear(),(0,r._)(this,h).values()))e.value=!1;for(let e of(0,r._)(this,f).values())e.value=void 0;this.notify((0,r._)(this,d))}}constructor(...e){super(),(0,i._)(this,d,{writable:!0,value:void 0}),(0,i._)(this,h,{writable:!0,value:new Map}),(0,i._)(this,f,{writable:!0,value:new Map}),(0,l._)(this,d,new Map(...e))}}},49884:(e,t,n)=>{n.d(t,{Ay:()=>w,Xu:()=>N});var r,i=n(74848),l=n(69599),o=n(25641),a=n(79064),s=n(53419),c=n(38621),u=n(73783),d=n(94236),h=n(5524),f=n(96540),p=n(61282),m=n(35247),g=n(39619),v=n(51213),x=n(75045);let y={"menu-button":"CopilotCodeLinesMenu-module__menu-button--uhNg6"},b="code-line-dropdown-copilot-button";function w({copilotAccessAllowed:e,messageReference:t,hideDropdown:n,id:r,showAgentTaskButton:s,currentRepo:w,currentReference:j}){let[R,_]=(0,f.useState)(!1),[S,k]=(0,f.useState)("actionMenu"),B=(0,l.G7)("copilot_chat_opening_thread_switch"),O=(0,f.useCallback)(()=>{L(t.type,E(t.type));let e={intent:v.wh.conversation,references:[t],id:r};(0,g.qR)(e),_(!1)},[r,t]),A=()=>{L(t.type,E(t.type)),"file"===t.type&&m.W.copilotRedirectFileViewToImmersive?"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(max-width: 767px)").matches?window.location.href="/copilot":window.location.href=`/copilot?reference_id=${(0,o.Vb)(t)}`:"snippet"===t.type&&m.W.copilotRedirectSnippetToImmersive?(a.Jt.setCurrentReferences(null,[t]),window.location.href="/copilot"):n?N(t,!0,r):O()},$=({children:e})=>(0,i.jsxs)(u.A,{children:[(0,i.jsx)(x.c,{referenceType:t.type,onClick:A,id:r}),e]});return e?n?(0,i.jsx)(x.c,{referenceType:t.type,onClick:A,id:r}):(0,i.jsxs)(i.Fragment,{children:["actionMenu"===S&&(0,i.jsx)($,{children:(0,i.jsxs)(d.W,{open:R,onOpenChange:_,children:[(0,i.jsx)(d.W.Button,{id:b,trailingAction:c.TriangleDownIcon,size:"small","aria-label":"Copilot menu",className:y["menu-button"],children:(0,i.jsx)(i.Fragment,{})}),(0,i.jsx)(d.W.Overlay,{align:"end",onKeyDown:e=>{"Escape"===e.key&&(e?.stopPropagation(),_(!1))},children:(0,i.jsxs)(h.l,{children:[(0,i.jsx)(h.l.Item,{onSelect:()=>{L(t.type,E(t.type)),m.W.copilotRedirectSnippetToImmersive&&"snippet"===t.type?(a.Jt.setEntrypointMessage("Explain this snippet",[t]),window.location.href="/copilot"):(0,g.qR)({content:"Explain",intent:v.wh.explain,references:[t],id:b}),_(!1)},children:"Explain"}),(0,i.jsx)(h.l.Item,{onSelect:()=>{let e="Suggest improvements to this code.";m.W.copilotRedirectSnippetToImmersive&&"snippet"===t.type?(L(t.type,E(t.type)),a.Jt.setEntrypointMessage(e,[t]),window.location.href="/copilot"):(0,g.qR)({content:e,intent:v.wh.suggest,references:[t],id:b}),_(!1)},children:"Suggest improvements"}),s&&(0,i.jsx)(h.l.Item,{onSelect:()=>{k("newTask")},children:"New agent task"}),!m.W.copilotRedirectSnippetToImmersive&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h.l.Divider,{}),(0,i.jsx)(h.l.Item,{onSelect:()=>{B?C(t,b):N(t,!0,b),_(!1)},children:"Attach to current thread"})]})]})})]})}),"newTask"===S&&(0,i.jsx)($,{children:(0,i.jsx)(p.V,{isIconButton:!0,icon:c.TriangleDownIcon,size:"small",label:"Copilot menu",eventType:"new_agent_task_button_codeview_line_selection",currentReference:j,currentRepo:w,hideRepoSelector:!0,open:!0,onClose:()=>k("actionMenu"),setContentOpen:e=>{e||k("actionMenu")}})})]}):null}let C=(e,t)=>{(0,g.Oc)(e,!1,t),(0,g.qR)({intent:v.wh.conversation,id:t,attachThread:!0})},N=(e,t,n)=>{t?((0,g.Oc)(e,!0,n),(0,g.qR)({intent:v.wh.conversation,id:n})):(0,g.qR)({intent:v.wh.conversation,references:[e],id:n})};function E(e){return"file"===e&&m.W.copilotRedirectFileViewToImmersive||"snippet"===e&&m.W.copilotRedirectSnippetToImmersive?"immersive":"assistive"}function L(e,t){(0,s.BI)("dotcom_chat.activate",{target:e,mode:t})}try{w.displayName||(w.displayName="CopilotCodeLinesMenu")}catch{}try{(r=CopilotButtonGroup).displayName||(r.displayName="CopilotButtonGroup")}catch{}},56677:(e,t,n)=>{n.d(t,{U:()=>o,p:()=>a});var r=n(74848),i=n(64830),l=n(87448);function o({symbols:e,focusedSymbol:t,lineNumber:n,sx:o,isNotUsingWhitespace:s,className:c}){let u=0,d=e.length>0?e[0].bodyText:"",h=`overlay-${n}-${o?"blob":"panel"}-${d}`,f=(0,i.ud)().codeWrappingOption,p=e.length>0&&!s?e[0].leadingWhitespace??0:0;return(0,r.jsxs)(l.EY,{className:c,sx:{mb:"-20px",color:"transparent",position:"absolute",overflowWrap:f.enabled?"anywhere":"unset",maxWidth:f.enabled?"100%":"unset",maxHeight:"6rem",overflow:"hidden",width:"100%",display:"inline-block",userSelect:"none",...o},children:[e.map(e=>{let n=(0,r.jsxs)("span",{children:[(0,r.jsx)(l.EY,{sx:{userSelect:"none",visibility:"hidden"},children:d.substring(u,e.ident.start.column+p)}),(0,r.jsx)(l.EY,{sx:{bg:e===t?"#ff9632":"var(--bgColor-attention-muted)",zIndex:e===t?10:void 0,color:e===t?"black":void 0,position:e===t?"relative":void 0,userSelect:"none",pointerEvents:"none"},children:(0,r.jsx)(l.EY,{sx:{visibility:e!==t?"hidden":void 0},id:a(e.lineNumber,e.ident.start.column+p),children:d.substring(e.ident.start.column+p,e.ident.end.column+p)})})]},`symbol-${e.ident.start.line}-${e.ident.start.column+p}`);return u=e.ident.end.column+p,n}),(0,r.jsx)(l.EY,{sx:{visibility:"hidden",userSelect:"none"},children:d.substring(u)})]},h)}function a(e,t){return`match-${e}-${t}`}try{o.displayName||(o.displayName="HighlightedOverlay")}catch{}},57472:(e,t,n)=>{n.d(t,{Bg:()=>g,FS:()=>p});var r=n(74848),i=n(12918),l=n(73017),o=n(73342),a=n(54571),s=n(96540),c=n(70395),u=n(75408),d=n(29806),h=n(94001),f=n(44314);let p=s.memo(s.forwardRef(m));function m({id:e,stylingDirectivesLine:t,rawText:n,lineNumber:i,current:a,forceVisible:s,shouldUseInert:f},p){let m=function(){let e=(0,u.fY)(),t=(0,d.hO)(),n=(0,d.Gb)();return!e||n?"plain":t&&!n?"separated-characters-chunked":"data-attribute"}(),{tabSize:g}=(0,c.A)(),v=(0,h.bp)(),x=(0,o.W)(void 0,t,n,s?"plain":m,g,v);return(0,r.jsx)(l.$6,{id:e,className:"react-file-line html-div","data-testid":"code-cell","data-line-number":i,html:x,ref:p,style:{position:"relative"},"aria-current":a?"location":void 0,...f?{inert:"inert"}:{}})}let g=s.memo(v);function v({linesData:e,colorizedLines:t}){let n=function(e,t,n){let[r]=(0,a.I)(()=>!1,!0,[]);return(0,s.useMemo)(()=>t?t.map((l,o)=>{if(o>=e.length)return null;let a="",s="";o%f.kd!=0||r||(a=r?"
":'
'),(o+1)%f.kd!=0&&o!==t.length||r||(s="
");let c=0!==l.length?l:` `,u=n?(0,i.Gx)(c)??c:c;return`${a}
${u}
${s}`}).join(` `):"
",[e,t,r,n])}(e,t??null,(0,h.bp)()),o=(0,d.Gb)();return(0,r.jsx)(l.$6,{...o?{inert:"inert"}:{},html:n})}try{p.displayName||(p.displayName="SyntaxHighlightedLine")}catch{}try{m.displayName||(m.displayName="SyntaxHighlightedLineWithRef")}catch{}try{g.displayName||(g.displayName="SyntaxHighlightedOverlay")}catch{}try{v.displayName||(v.displayName="SyntaxHighlightedOverlayUnmemoed")}catch{}},57555:(e,t,n)=>{n.d(t,{m:()=>y});var r=n(74848),i=n(6665),l=n(53627),o=n(64830),a=n(88431),s=n(34164),c=n(96540),u=n(60619),d=n(75408),h=n(29806),f=n(87011),p=n(94001),m=n(58150),g=n(4446),v=n(68340),x=n(5625);let y=c.memo(b);function b({codeLineData:e,onClick:t,ownedCodeSections:n,onCollapseToggle:y,preventClick:b,onLineStickOrUnstick:w,virtualOffset:C,copilotAccessAllowed:N}){let{lineNumber:E,ownedSection:L,codeLineClassName:j,isStartLine:R,codeownersLineError:_,hiddenUnicode:S}=e,{sendRepoClickEvent:k}=(0,i.T)(),B=(0,d.Jo)(),O=(0,c.useCallback)(e=>{let n,r;if(e.defaultPrevented)return;let i=parseInt(e.currentTarget.getAttribute("data-line-number"),10),o=(0,u.$c)(`L${i}`),a=B.current;if(a&&(a.start.line!==a.end.line||a.start.column!==a.end.column))n=a.start,r=a.end;else{let e=window.getSelection()?.rangeCount?window.getSelection()?.getRangeAt(0):null;e&&(n=(0,h.um)(e.startContainer,e.startOffset),r=(0,h.um)(e.endContainer,e.endOffset))}let s=!1;n&&r&&n.line<=i&&r.line>=i&&(s=!0,o={anchorPrefix:"",blobRange:{start:n,end:r}});let{blobRange:c}=o,d=(0,u.eC)(window.location.hash);d&&e.shiftKey&&!s?(k("BLOB.MULTILINE"),o.blobRange={start:d.start,end:c.end}):k("BLOB.LINE");let f=(0,u.JB)(o);(0,l.Zu)(f),t?.(e)},[t,B,k]),A=(0,v.kT)(E),$=A?.start.line===E,I=A&&A.start.line=E||$&&A?.start.column===null,T=(0,c.useRef)(null),D=(0,c.useRef)(null),M=(0,c.useRef)(null),[z,U]=(0,c.useState)(!1);(0,a.N)(()=>{$&&D.current?.setAnchor(T.current)},[$]);let{codeFoldingOption:F}=(0,o.ud)(),H=F.enabled,P=e=>{N&&(U(e),setTimeout(()=>M.current?.setAnchor(e?T.current:null),0))};return(0,c.useEffect)(()=>{!F.enabled&&((0,h.X5)(),y?.(!1),L&&(L.collapsed=!1))},[F.enabled,L,y]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{ref:e=>{T.current=e},"data-line-number":E,className:(0,s.$)(j,"react-line-number react-code-text",C&&"virtual",b&&"prevent-click",I&&"highlighted-line"),style:C?{paddingRight:"16px",transform:`translateY(${C}px)`}:{paddingRight:"16px"},onMouseDown:b?void 0:O,onMouseEnter:N?()=>P(!0):void 0,onMouseLeave:N?()=>P(!1):void 0,children:[E,_&&(0,r.jsx)(x.cw,{children:(0,r.jsx)(f.pO,{})}),S&&(0,r.jsx)(x.cw,{children:(0,r.jsx)(p.T4,{})}),H&&R&&L&&n&&(0,r.jsx)(x.cw,{displayRight:!0,children:(0,r.jsx)(x._Y,{codeLineData:e,onCollapseToggle:y,onLineStickOrUnstick:w})})]}),$&&(0,r.jsx)(g.Ay,{codeLineClassName:j,ref:D,rowBeginId:`LG${A.start.line}`,rowBeginNumber:A.start.line,rowEndNumber:A.end.line,rowEndId:`LG${A.end.line}`}),N&&z&&(0,r.jsx)("div",{children:(0,r.jsx)(m.z8,{ref:M,rowBeginNumber:E,rowEndNumber:E,id:"code-line-copilot-button"})})]})}try{y.displayName||(y.displayName="LineNumberNoVirtualziation")}catch{}try{b.displayName||(b.displayName="LineNumberNoVirtualizationUnmemoized")}catch{}},58150:(e,t,n)=>{n.d(t,{eT:()=>x,z8:()=>y});var r=n(74848),i=n(53552),l=n(49884),o=n(78314),a=n(69599),s=n(68911),c=n(88431),u=n(87448),d=n(96540),h=n(40961),f=n(70395),p=n(68566),m=n(68340);let g="copilot-button-positioner",v="copilot-button-container";function x({children:e}){return(0,r.jsxs)(u.az,{id:g,sx:{position:"relative"},children:[e,(0,r.jsx)("div",{id:v})]})}let y=d.memo(d.forwardRef(b));function b({rowBeginNumber:e,rowEndNumber:t,id:n,recalcPosition:u},x){let[y,b]=(0,d.useState)(null);(0,d.useImperativeHandle)(x,()=>({setAnchor:b}));let[w,C]=(0,d.useState)(void 0);(0,c.N)(()=>{let e=()=>requestAnimationFrame(()=>C(function(e,t={x:0,y:0}){let n=document.getElementById(g);if(!e||!n)return{display:"none"};let{top:r,height:i}=e.getBoundingClientRect(),{top:l}=n.getBoundingClientRect(),o=(p.u9-i)/2;return{top:`${r-l-o+t.y+1}px`,right:"37px"}}(y)));return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[y,u]);let{copilotAccessAllowed:N,refInfo:E,path:L}=(0,i.eu)(),j=(0,m.Df)(),R=(0,o.t)(),{language:_,languageID:S,copilotSWEAgentEnabled:k}=(0,f.A)(),B=(0,d.useMemo)(()=>({type:"snippet",languageID:S,languageName:_,path:L,range:{start:e,end:t},ref:(0,s.D7)(E.name,E.refType),commitOID:E.currentOid,repoID:R.id,repoName:R.name,repoOwner:R.ownerLogin,url:window.location.href}),[S,_,L,e,t,E,R]),O=(0,a.G7)("copilot_agent_tasks_btn_code_view_lines")&&k,A=void 0===w?null:(0,r.jsx)("div",{style:{alignSelf:"center",position:"absolute",lineHeight:"16px",height:"24px",width:"24px",zIndex:2,...w},children:(0,r.jsx)(l.Ay,{copilotAccessAllowed:N,messageReference:B,id:n,showAgentTaskButton:O,currentRepo:R,currentReference:{path:L,range:j?{start:j.start.line,end:j.end.line}:void 0}})}),$=document.getElementById(v);return $?(0,h.createPortal)(A,$):null}try{x.displayName||(x.displayName="CopilotButtonContainer")}catch{}try{y.displayName||(y.displayName="CopilotButton")}catch{}try{b.displayName||(b.displayName="CopilotButtonWithRef")}catch{}},60619:(e,t,n)=>{function r(e){let t=e.match(/#?(?:L)(\d+)((?:C)(\d+))?/g);if(t){if(1===t.length){let e=a(t[0]);if(!e)return;return Object.freeze({start:e,end:e})}if(2!==t.length)return;{let e=a(t[0]),n=a(t[1]);if(!e||!n)return;return u(Object.freeze({start:e,end:n}))}}}function i(e){let{start:t,end:n}=u(e);return null!=t.column&&null!=n.column?`L${t.line}C${t.column}-L${n.line}C${n.column}`:null!=t.column?`L${t.line}C${t.column}-L${n.line}`:null!=n.column?`L${t.line}-L${n.line}C${n.column}`:t.line===n.line?`L${t.line}`:`L${t.line}-L${n.line}`}function l(e){return{blobRange:r(e),anchorPrefix:function(e){let t=e.length<5e3&&e.match(/(file-.+?-)L\d+?/i);return t?t[1]:""}(e)}}function o({anchorPrefix:e,blobRange:t}){return t?`#${e}${i(t)}`:"#"}function a(e){let t=e.match(/L(\d+)/),n=e.match(/C(\d+)/);return t?Object.freeze({line:parseInt(t[1]),column:n?parseInt(n[1]):null}):null}function s(e,t){let[n,r]=c(e.start,!0,t),[i,l]=c(e.end,!1,t);if(!n||!i)return;let o=r,a=l;if(-1===o&&(o=0),-1===a&&(a=i.childNodes.length),!n.ownerDocument)throw Error("DOMRange needs to be inside document");let s=n.ownerDocument.createRange();return s.setStart(n,o),s.setEnd(i,a),s}function c(e,t,n){let r=[null,0],i=n(e.line);if(!i)return r;if(null==e.column)return[i,-1];let l=e.column-1,o=function e(t){if(t.nodeType===Node.TEXT_NODE)return[t];if(!t.childNodes||!t.childNodes.length)return[];let n=[];for(let r of t.childNodes)n=n.concat(e(r));return n}(i);for(let e=0;el,JB:()=>o,Kn:()=>i,Py:()=>s,eC:()=>r})},68239:(e,t,n)=>{n.d(t,{EN:()=>s,Px:()=>u,YP:()=>c,pm:()=>d});var r=n(74848),i=n(96540),l=n(87613),o=n(70395);let a=i.createContext(null);function s({children:e}){let t=(0,o.A)(),n=(0,l.O)(),s=i.useMemo(()=>n?null:new Map,[t,n]);return(0,r.jsxs)(a.Provider,{value:s,children:[" ",e," "]})}function c(){return i.useContext(a)}function u(){let e=i.useContext(a);return(0,i.useCallback)(t=>e?.get(t),[e])}function d(){let e=i.useContext(a);return(0,i.useCallback)((t,n)=>{e&&(e.has(t)?e.get(t)?.push(n):e.set(t,[n]))},[e])}try{a.displayName||(a.displayName="CurrentLineRefMapContext")}catch{}try{s.displayName||(s.displayName="CurrentLineRefMapProvider")}catch{}},68340:(e,t,n)=>{n.d(t,{Df:()=>c,iU:()=>s,kT:()=>u});var r=n(74848),i=n(49835),l=n(33535),o=n(96540);let a=o.createContext(new i.Lj(void 0));function s({highlightedLines:e,children:t}){let n=(0,l.AI)(e);return(0,o.useEffect)(()=>{n.value=e},[n,e]),(0,r.jsx)(a.Provider,{value:n,children:t})}function c(){return(0,l.HN)(o.useContext(a))}function u(e){let t=o.useContext(a),n=(0,l.Sk)(t,t=>t&&e>=t.start.line&&e<=t.end.line?t:void 0);return(0,l.HN)(n)}try{a.displayName||(a.displayName="HighlightedLineContext")}catch{}try{s.displayName||(s.displayName="HighlightedLinesProvider")}catch{}},68566:(e,t,n)=>{n.d(t,{S9:()=>s,sZ:()=>c,u9:()=>a,uU:()=>o,zM:()=>function e(t){let n=t?.textContent??"";if(""!==n)return n;if(t){let r=t.childNodes;for(let t=0;t{if(!e)return;let{lineNumber:n,ownedSection:r}=e;r&&(r.collapsed=!1),o?.(),(0,l.ny)(n),t?.(e,!0)},[e,o,t]),u=(0,i.useCallback)(()=>{if(!e)return;let{lineNumber:t,ownedSection:n}=e;n&&(n.collapsed=!0),o?.(),(0,l.E8)(t)},[e,o]);return{setShouldBeOpen:s,expandOrCollapseSection:function(){if(!e)return;let{ownedSection:t}=e;t&&(t.collapsed?(c(),(0,l.kY)("Code section expanded")):(u(),(0,l.kY)("Code section collapsed"))),s(!1,!0)},openUpRefSelector:function(){let e=document.getElementsByClassName("ref-selector-class");e&&1===e.length?(e[0]?.click(),(0,r.i)("ref selector opened")):e&&2===e.length&&(e[1]?.click(),(0,r.i)("ref selector opened")),s(!1)}}}function c(e,t={x:0,y:0}){let n=document.getElementById(o);if(!e||!n)return{display:"none"};let{top:r,left:i,height:l}=e.getBoundingClientRect(),{top:s,left:u}=n.getBoundingClientRect();return{top:`${r-s-(a-l)/2+t.y}px`,left:`${Math.max(i-u+t.x,0)-13}px`}}},68657:(e,t,n)=>{n.d(t,{I:()=>E,S:()=>C});var r=n(74848),i=n(64830),l=n(88431),o=n(91359),a=n(87448),s=n(34164),c=n(96540),u=n(70395),d=n(5020),h=n(96657),f=n(80166),p=n(29806),m=n(58150),g=n(56677),v=n(19973),x=n(68340),y=n(911),b=n(57472);let w=()=>{},C=c.memo(N);function N({codeLineData:e,codeLineClassName:t,id:n,onClick:o,setIsCollapsed:a,onLineStickOrUnstick:C,virtualOffset:N,codeLineToSectionMap:L,stylingDirectivesLine:j,virtualKey:R,forceVisible:_,measureRef:S,virtualIndex:k,copilotAccessAllowed:B,shouldUseInert:O}){let{lineNumber:A,rawText:$}=e,I=(0,p.$0)(A),{tabSize:T}=(0,u.A)(),D=(0,x.kT)(A),M=(0,c.useRef)(null),z=D&&M.current?(0,p.jH)(D,M.current,A,T,$??""):void 0,U=L?.get(A)?.length??0,F=(0,f.ds)(),H=(0,d.L)(e,!0,F,C??w,U),P=(0,i.ud)().codeWrappingOption,W=(0,y.WB)(A),Y=(0,y.e6)(A),X=(0,h.o)("react-line-numbers"),G=D?.start.line===A,V=(0,c.useRef)(null),K=(0,c.useRef)(null);return(0,l.N)(()=>{G&&K.current?.setAnchor(V.current)},[G]),(0,r.jsx)("div",{ref:e=>{S?.(e),H(e)},"data-key":R,"data-index":k,className:(0,s.$)(t,"react-code-text react-code-line-contents",N&&"virtual",P.enabled&&S&&"react-code-text-cell"),style:{transform:N?`translateY(${N}px)`:void 0,minHeight:P.enabled?X:"auto"},onClick:o,children:(0,r.jsxs)("div",{ref:V,children:[D&&(0,r.jsx)(E,{lineNumber:A,highlightPosition:z}),I&&!D&&(0,r.jsx)(E,{subtle:!0,lineNumber:A,highlightPosition:z}),W&&W.length>0&&(0,r.jsx)(g.U,{symbols:W,focusedSymbol:Y,sx:{paddingLeft:"10px",width:"auto"},lineNumber:A}),(0,r.jsx)(b.FS,{id:n,lineNumber:A,stylingDirectivesLine:j,current:!!D,rawText:$,forceVisible:_,ref:M,shouldUseInert:O}),P.enabled&&(0,r.jsx)(v.M,{codeLineData:e,setIsCollapsed:a,onLineStickOrUnstick:C,leftOffset:0}),G&&B&&(0,r.jsx)(m.z8,{ref:K,rowBeginNumber:D.start.line,rowEndNumber:D.end.line,id:"code-line-copilot-button"})]})})}function E({lineNumber:e,highlightPosition:t,subtle:n}){let i=(0,o.Y)(),l=t?.offset!==void 0,s=t?.width!==void 0,c=t?.offset??-72,u=t?.width??0;return(0,r.jsx)(a.az,{sx:{position:"absolute",backgroundColor:n?"neutral.subtle":"var(--bgColor-attention-muted, var(--color-attention-subtle))",height:"100%",opacity:".6",boxShadow:n?"inset 2px 0 0 var(--fgColor-muted, var(--color-fg-subtle))":"inset 2px 0 0 var(--fgColor-attention, var(--color-attention-fg))",top:i?"-3px":0,left:`${c}px`,width:s?`${l&&s?u:u+82}px`:"calc(100% + 72px)",pointerEvents:"none"}},`highlighted-line-${e}`)}try{C.displayName||(C.displayName="CodeLine")}catch{}try{N.displayName||(N.displayName="CodeLineUnmemoized")}catch{}try{E.displayName||(E.displayName="HighlighterElement")}catch{}},68911:(e,t,n)=>{n.d(t,{D7:()=>i,MQ:()=>r,gE:()=>l});let r=e=>{if(e){if(e.startsWith("refs/tags/"))return"tag";if(e.startsWith("refs/heads/"))return"branch"}},i=(e,t)=>"branch"===t?`refs/heads/${e}`:"tag"===t?`refs/tags/${e}`:e,l=e=>{if(!e)return;if(!r(e))return e;let[,,...t]=e.split("/");return t.join("/")}},70395:(e,t,n)=>{n.d(t,{A:()=>a,s:()=>o});var r=n(74848),i=n(96540);let l=i.createContext({});function o({blob:e,children:t}){return(0,r.jsxs)(l.Provider,{value:e,children:[" ",t," "]})}function a(){return i.useContext(l)}try{l.displayName||(l.displayName="CurrentBlobContext")}catch{}try{o.displayName||(o.displayName="CurrentBlobProvider")}catch{}},73342:(e,t,n)=>{n.d(t,{W:()=>u});var r=n(96540),i=n(21537),l=n(27473),o=n(12918);function a(e,t,n,r,i,l,o){let a=t.substring(n,r);return{c:e,s:n,e:r,text:"plain"!==o?function(e,t,n){let r=[];for(let i of e)if(" "===i){let e=t-n.value%t;r.push(Array(e).fill(" ").join("")),n.value+=e}else r.push(i),n.value+=Array.from(i).length;return r.join("")}(a,l,i):a}}function s(e){return e.replace(/[&<>"']/g,c)}function c(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case"'":return"'";default:return e}}function u(e,t,n,c="plain",d,h){return(0,r.useMemo)(()=>e??function(e,t,n,r,c){e||(e=` `);let u=function(e,t,n,r){let i={value:0},l={nodes:[],s:0,e:e.length,c:""},o=t?.filter(e=>e.e>e.s);if(!o||0===o.length)return l.nodes.push(a("",e,0,e.length,i,r,n)),l;let s=[l];for(let t=0;td.s){let t=a("",e,d.s,c.s,i,r,n);d.nodes.push(t)}else if(h&&c.s>h.e){let t=a("",e,h.e,c.s,i,r,n);d.nodes.push(t)}if(u&&u.s=d.e){let t=c.e;if(d.e>t){let l=a("",e,t,d.e,i,r,n);d.nodes.push(l),t=d.e}for(;s.length>1&&u.s>=d.e;)if(s.pop(),d=s[s.length-1]??l,s.length>1&&u.s>=d.e&&d.e>t){let l=a("",e,t,d.e,i,r,n);t=d.e,d.nodes.push(l)}}}for(;s.length>0;){let t=s.pop(),l=t.nodes[t.nodes.length-1];if(l&&l.e`),t.nodes))"nodes"in a?e(a,n,r,l):l.push(function e(t,n,r){switch(n){case"data-attribute":{let l=s(t.text);if(r&&(0,i.Y)(l)){let r=(0,i.t6)(l).map(r=>{let l=(0,i._n)(r);return l?(0,i.rE)(l):e({...t,text:r,c:""},n,!1)});return t.c?`${r.join("")}`:r.join("")}return t.c?``:``}case"separated-characters-chunked":case"separated-characters":{if(t.text&&!t.text.trim())return e({...t},"data-attribute",r);let l=[...t.text];"separated-characters-chunked"!==n||r||(l=t.text.match(/.{1,2}/g)??l);let o=[...l].map(e=>{let t=r?(0,i._n)(e):void 0;return t?(0,i.rE)(t):``}).join("");return t.c?`${o}`:o}default:{let e=s(t.text),n=r?(0,o.Gx)(e)??e:e;return t.c?`${n}`:n}}}(a,n,r));t.c&&l.push("")}(u,n,c,d),d.join("")}(n,t,c,d,h),[n,e,t,c,d,h])}},75045:(e,t,n)=>{n.d(t,{c:()=>a});var r=n(74848),i=n(38621),l=n(26108),o=n(96540);function a({children:e,referenceType:t,...n}){let a=(0,o.useRef)(null);return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(l.K,{ref:a,icon:i.CopilotIcon,size:"small","aria-label":`Ask Copilot about this ${t}`,tooltipDirection:"n","data-testid":"copilot-ask-menu",...n})})}try{a.displayName||(a.displayName="AskCopilotButton")}catch{}},75408:(e,t,n)=>{n.d(t,{DC:()=>_,Jo:()=>S,M1:()=>O,M_:()=>x,Ov:()=>k,QM:()=>v,aM:()=>j,cH:()=>y,di:()=>b,fY:()=>B,ue:()=>R});var r=n(49835),i=n(33535),l=n(88934),o=n(27473),a=n(54571),s=n(64830),c=n(39111),u=n(96540),d=n(60619),h=n(77031),f=n(29806),p=n(87613),m=n(96657),g=n(76455);let v=7.2293,x=92,y=92,b=70,w=new r.Lj(1),C=new r.Lj(0),N=new r.Lj(1),E=new r.Lj(0),L=new r.Lj(!1);function j(){return(0,i.HN)(w)}function R(){return(0,i.HN)(N)}function _(){return(0,i.HN)(L)}function S(){let e=(0,u.useRef)(null);function t(){e.current={start:{line:w.value,column:C.value+1},end:{line:N.value,column:E.value+1}}}return(0,i.Rs)(w,t),(0,i.Rs)(C,t),(0,i.Rs)(N,t),(0,i.Rs)(E,t),e}function k(e){L.value=e}function B(e){let t=(0,s.ud)().codeWrappingOption.enabled,n=!!(0,p.O)(),[r]=(0,a.I)(()=>!1,!0,[]);return!t&&!n&&!e&&!r}function O(e,t,n,r,i,a,s,p,j,R,_,S){let k=(0,u.useRef)(0),B=(0,u.useRef)(0),O=(0,u.useRef)(0),A=(0,u.useRef)(0),$=(0,u.useRef)(0),I=(0,u.useRef)(0),T=(0,u.useRef)(null),D=(0,u.useRef)(0),M=(0,u.useRef)(0),z=(0,u.useRef)(15),U=(0,u.useRef)(0),F=s?y:x,H=(0,c.X)(["windows"])?6.6:v,P=(0,m.o)("react-line-numbers"),{stylingDirectives:W}=(0,h.PL)(),Y=(0,u.useMemo)(()=>{let e=[];for(let t=0;t{let t=w.value!==N.value,n={start:{line:w.value,column:t?C.value+1:null},end:{line:N.value,column:t?E.value+1:null}},r={anchorPrefix:"L",blobRange:{start:n.start,end:n.end}},i=(0,d.JB)(r);window.location.hash=i,p?.(e)},[p]),{hash:K}=(0,l.zy)();function q(e){let t=0,n=0,r=0,i=0,l=0,o=0,a=Y.length-1;for(;o<=a;){let s=Math.floor((o+a)/2);if(r=Y[s]+1,i=s>0?Y[s-1]+1:0,l=s=i&&e=r&&e=l&&(o=s+1)}return{line:t,offset:n}}function J(e,t,n,r,i){k.current=e,B.current=n,O.current=t,A.current=r,$.current=i?e:t,I.current=i?n:r,w.value=es(e),C.value=n,N.value=es(t),E.value=r}function Q(){return k.current===$.current&&B.current===I.current&&(k.current!==O.current||B.current!==A.current)?"start":O.current===$.current&&A.current===I.current&&(k.current!==O.current||B.current!==A.current)?"end":"same"}function Z(){if(j&&j.current){let e=j.current,t=k.current-1,n=O.current-1,r=(-1!==t?Y[t]+1:0)+B.current,i=(-1!==n?Y[n]+1:0)+A.current;e.selectionStart=r,e.selectionEnd=i,M.current=r,U.current=i}}function ee(){el();let e=k.current,t=B.current;e+z.current>i.length?e=i.length-1:e+=z.current,t=er(e,t),k.current=e,B.current=t,en(),G(e*P,e),eo(b)}function et(){el();let e=k.current,t=B.current;ei.length||!i[e])return n;let r=i[e].rawText;return r&&(t>r.length?(n=r.length,X((0,f.m)(n,r,R),n)):n=r.length&&(n=r.length,X((0,f.m)(n,r,R),n))),n}function ei(){let e=i[$.current];if(!e)return;let{rawText:n}=e,r=W?W[e.lineNumber-1]:e.stylingDirectivesLine;if(!n||!r)return;let l=(0,o.M)(r),a=null;for(let e of l)if(!(e.s>I.current)&&!(e.e=T.current.scrollLeft+T.current.clientWidth?T.current.scrollBy(n*H+F-T.current.scrollLeft-T.current.clientWidth+e,0):n*H+F<=T.current.scrollLeft&&T.current.scrollBy(n*H+F-T.current.scrollLeft-T.current.clientWidth,0))}(e)),Z()}function ea(){let e=Q(),t=B.current,n=k.current;"end"===e&&(t=A.current,n=O.current);let r=Math.min(es(n+5),i.length);if(!(0,f.si)(r)){let e=(0,f.ap)(r);null===e&&window.scrollTo(0,n*P),e&&e.getBoundingClientRect().y<0||e&&e.getBoundingClientRect().y>window.innerHeight?(e.scrollIntoView({block:"center"}),window.scrollBy(-300,0)):e&&window.scrollBy(0,100),window.innerWidthwindow.innerHeight?(e.scrollIntoView({block:"center"}),window.scrollBy(-300,0)):e&&window.scrollBy(0,-200)}}function es(e){return i[e]?i[e].lineNumber:e}return(0,u.useEffect)(()=>{z.current=Math.min(Math.max(Math.round((window.innerHeight-200>300?window.innerHeight-200:300)/P),1),100)},[P]),(0,u.useEffect)(()=>{_&&""!==_&&(_.includes("PageUp")?et():_.includes("PageDown")&&ee())},[_]),(0,u.useEffect)(()=>{if(!S||S.start<0&&S.end<0||M.current===S.start&&U.current===S.end)return;let e=q(S.start),t=q(S.end);(M.current!==S.start||U.current===S.end)&&(S.keyboard||S.displayStart)?(X((0,f.m)(e.offset,i[e.line]?.rawText??"",R),e.offset),D.current=e.offset,G(e.line*P,e.line),J(e.line,t.line,e.offset,t.offset,!0)):(X((0,f.m)(t.offset,i[t.line]?.rawText??"",R),t.offset),D.current=t.offset,G(t.line*P,t.line),J(e.line,t.line,e.offset,t.offset,!1)),U.current=S.end,M.current=S.start,S.end!==S.start||S.keyboard||(L.value=!1,ei()),$.current<=5&&S.keyboard&&ea()},[i,R,S]),(0,u.useEffect)(()=>{let e=(0,d.$c)(K);if(!e.blobRange?.start?.line||e.blobRange.start.line>i.length)return;let t=e.blobRange.start.line-1;k.current=t,w.value=t,C.value=0,N.value=t,E.value=0,B.current=0,O.current=t,A.current=0,D.current=0,X(B.current,B.current),G(k.current*P,k.current),eo(b)},[K,i,n,r]),{onEnter:function(){L.value=!0,(0,g.FO)(),ei()},updateUrlForLineNumber:V,onPageDown:ee,onPageUp:et,currentStartLine:k,currentStartChar:B,currentEndLine:O,currentEndChar:A,determineAndSetTextAreaCursorPosition:Z,getCorrectLineNumberWithCollapsedSections:es}}},76455:(e,t,n)=>{n.d(t,{DE:()=>a,FO:()=>o,Gp:()=>l});var r=n(96540);let i="react_blob_view_focus_symbol_pane";function l(e){let t=(0,r.useRef)(e);(0,r.useEffect)(()=>{t.current=e},[e]),(0,r.useEffect)(()=>{let t=t=>{e(t.detail?.focusSymbolSearch||!1)};return window.addEventListener(i,t),()=>{window.removeEventListener(i,t)}},[e])}function o(){window.dispatchEvent(new CustomEvent(i))}function a(){window.dispatchEvent(new CustomEvent(i,{detail:{focusSymbolSearch:!0}}))}},77031:(e,t,n)=>{n.d(t,{PL:()=>h,TX:()=>f,Zj:()=>d});var r=n(74848),i=n(25407),l=n(91747),o=n(96379),a=n(96540),s=n(44314);let c={stylingDirectives:null},u=a.createContext(c);function d({children:e,...t}){return(0,r.jsx)(u.Provider,{value:t,children:e})}function h(){return a.useContext(u)}function f(e,t,n,r,u){let[d,h]=(0,a.useState)(c),f=(0,l.u)("react_blob_overlay"),p=t&&!r?(0,i.rzN)({repo:e,commitish:t.name,path:n}):null;return(0,a.useEffect)(()=>{if(!p)return;if(u>s.OL||!f)return void h(c);let e=!1;return(async()=>{h(c);let t=await (0,o.lS)(p);if(!e)try{if(t.ok){let e=await t.json();e&&Array.isArray(e.stylingDirectives)&&h(e)}else h(c)}catch{h(c)}})(),function(){e=!0}},[p,u,f]),d}try{u.displayName||(u.displayName="DeferredASTContext")}catch{}try{d.displayName||(d.displayName="DeferredASTProvider")}catch{}},80166:(e,t,n)=>{n.d(t,{Us:()=>i,ds:()=>u,oM:()=>c});var r=n(96540);let i="repos-sticky-header",l="code_view_update_sticky_header_height_event",o=null,a=null,s=null;function c(e){e&&a!==e&&(a=e,null===o?o=new ResizeObserver(e=>{for(let t of e)t.contentRect.height!==s&&(s=t.contentRect.height,window.dispatchEvent(new CustomEvent(l,{detail:t.contentRect.height})))}):o.disconnect(),o.observe(e))}function u(){let[e,t]=(0,r.useState)(void 0);return((0,r.useEffect)(()=>{function e(e){t(e.detail)}return window.addEventListener(l,e),a&&c(a),()=>{window.removeEventListener(l,e)}},[]),void 0!==e)?e:102}},80427:(e,t,n)=>{n.d(t,{D:()=>r});function r(e){if("clipboard"in navigator)return navigator.clipboard.writeText(e);let t=document.body;if(!t)return Promise.reject(Error());let n=function(e){let t=document.createElement("pre");return t.style.width="1px",t.style.height="1px",t.style.position="fixed",t.style.top="5px",t.textContent=e,t}(e);return t.appendChild(n),!function(e){if("clipboard"in navigator)return navigator.clipboard.writeText(e.textContent||"");let t=getSelection();if(null==t)return Promise.reject(Error());t.removeAllRanges();let n=document.createRange();n.selectNodeContents(e),t.addRange(n),document.execCommand("copy"),t.removeAllRanges(),Promise.resolve()}(n),t.removeChild(n),Promise.resolve()}},87011:(e,t,n)=>{n.d(t,{bN:()=>f,$4:()=>p,pO:()=>v,kz:()=>x,Ke:()=>g});var r=n(74848),i=n(25407),l=n(96379),o=n(38621),a=n(72511),s=n(26108),c=n(10095),u=n(99906),d=n(96540);let h={Flash:"CodeownerFileBanner-module__Flash--dwY36",Flash_1:"CodeownerFileBanner-module__Flash_1--OS2TL",Box:"CodeownerFileBanner-module__Box--HgWQx",IconButton:"CodeownerFileBanner-module__IconButton--Yy_k4",Dialog:"CodeownerFileBanner-module__Dialog--arvdR",Box_1:"CodeownerFileBanner-module__Box_1--Rtx_4",Box_2:"CodeownerFileBanner-module__Box_2--X7HF6",Box_3:"CodeownerFileBanner-module__Box_3--KC_7L",Octicon:"CodeownerFileBanner-module__Octicon--eIlUl"},f={ERROR:"ERROR",LOADING:"LOADING",VALIDATED:"VALIDATED"};function p({errors:e,state:t}){let[n,i]=(0,d.useState)(!1),l=(0,d.useRef)(null);return t===f.ERROR?(0,r.jsx)(a.A,{variant:"warning",className:h.Flash,children:"Failed to validate this CODEOWNERS file"}):t===f.LOADING?(0,r.jsx)(a.A,{variant:"default",className:h.Flash,children:"Validating CODEOWNERS rules..."}):0===e.length?(0,r.jsx)(a.A,{variant:"success",className:h.Flash,children:"This CODEOWNERS file is valid."}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.A,{variant:"warning",className:h.Flash_1,children:[(0,r.jsx)(c.A,{icon:o.BugIcon}),(0,r.jsxs)("div",{onClick:()=>i(!n),className:h.Box,children:["This CODEOWNERS file contains errors",(0,r.jsx)(s.K,{"aria-label":"View CODEOWNERS errors",tooltipDirection:"s",ref:l,size:"small",icon:o.KebabHorizontalIcon,className:h.IconButton})]})]}),(0,r.jsxs)(u.A,{isOpen:n,onDismiss:()=>i(!1),returnFocusRef:l,className:h.Dialog,children:[(0,r.jsx)(u.A.Header,{children:"CODEOWNERS errors"}),(0,r.jsx)("div",{className:h.Box_1,children:e.map((e,t)=>(0,r.jsx)(m,{error:e},t))})]})]})}function m({error:e}){return(0,r.jsxs)("div",{className:h.Box_2,children:[`${e.kind} on line ${e.line}${e.suggestion?`: ${e.suggestion}`:""}`,(0,r.jsx)("pre",{className:h.Flash,children:(0,r.jsxs)("code",{children:[e.linePrefix,(0,r.jsx)("b",{className:h.Box_3,children:e.lineError}),e.lineSuffix]})})]})}function g(e){var t,n,r;let i=e.source.trim(),l=e.column-1,o=(t=l,n=e.end_column,r=i,n||(r.substring(t).indexOf(" ")>0?r.indexOf(" ",t):r.length));if(l>30){let e=l-30;i="\u2026"+i.slice(e),l-=e-1,o-=e-1}return{...e,linePrefix:i.substring(0,l),lineError:i.substring(l,o),lineSuffix:i.substring(o)}}function v(){return(0,r.jsx)(c.A,{icon:o.DotFillIcon,"aria-label":"This line contains CODEOWNERS errors",className:h.Octicon})}function x(e,t,n){return(0,l.lS)((0,i.$RX)({owner:e.ownerLogin,repo:e.name,commitish:t.name,filePath:n}),{method:"GET"})}try{p.displayName||(p.displayName="CodeownerFileBanner")}catch{}try{m.displayName||(m.displayName="CodeownersErrorDetails")}catch{}try{v.displayName||(v.displayName="CodeownersErrorLineIndicator")}catch{}},87613:(e,t,n)=>{n.d(t,{O:()=>a,k:()=>o});var r=n(74848),i=n(96540);let l=i.createContext(void 0);function o({blame:e,children:t}){return(0,r.jsxs)(l.Provider,{value:e,children:[" ",t," "]})}function a(){return i.useContext(l)}try{l.displayName||(l.displayName="CurrentBlameContext")}catch{}try{o.displayName||(o.displayName="CurrentBlameProvider")}catch{}},91359:(e,t,n)=>{n.d(t,{Y:()=>i});var r=n(96540);function i(){return(0,r.useSyncExternalStore)(a,l,o)}function l(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function o(){return!1}function a(){return()=>{}}},94001:(e,t,n)=>{n.d(t,{om:()=>v,T4:()=>x,Y:()=>C,bp:()=>N,$E:()=>w,TA:()=>b});var r=n(74848),i=n(71315),l=n(54571),o=n(38621),a=n(72511),s=n(57352),c=n(21373),u=n(10095),d=n(55255);let h={Flash:"HiddenUnicode-module__Flash--NH4EI",Button:"HiddenUnicode-module__Button--wjP7v",Octicon:"HiddenUnicode-module__Octicon--GY9_l"},f=/[\u202A-\u202E]|[\u2066-\u2069]|\u{E0001}|\u{E007F}/u,p=/[\u202A-\u202E]|[\u2066-\u2069]|\u{E0001}|\u{E007F}/gu,m=/([\u202A-\u202E]|[\u2066-\u2069]|\u{E0001}|\u{E007F})/gu,g=new Map(Object.entries({"\u202A":"U+202A","\u202B":"U+202B","\u202C":"U+202C","\u202D":"U+202D","\u202E":"U+202E","\u2066":"U+2066","\u2067":"U+2067","\u2068":"U+2068","\u2069":"U+2069","\u{E0001}":"U+E0001","\u{E007F}":"U+E007F"}));function v(){let[e]=(0,l.I)(()=>i.cg,i.cg,[]);if(!e)return null;let t=new URL(e.location.href,e.location.origin),n="1"===t.searchParams.get("h");return n?t.searchParams.delete("h"):t.searchParams.set("h","1"),(0,r.jsxs)(a.A,{full:!0,variant:"warning",className:h.Flash,children:[(0,r.jsx)(u.A,{icon:o.AlertIcon}),(0,r.jsxs)("span",{children:["This file contains bidirectional or hidden Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters."," ",(0,r.jsx)(s.A,{inline:!0,href:"https://github.co/hiddenchars",target:"_blank",rel:"noreferrer",children:"Learn more about bidirectional Unicode characters"})]}),(0,r.jsx)(c.Q,{as:"a",onClick:()=>{window.location.href=t.href},size:"small",className:h.Button,children:n?"Hide revealed characters":"Show hidden characters"})]})}function x(){return(0,r.jsx)(d.A,{direction:"e",text:"This line has hidden Unicode characters",children:(0,r.jsx)(u.A,{icon:o.AlertIcon,className:h.Octicon})})}function y({char:e}){return(0,r.jsx)("span",{className:"hidden-unicode-replacement padded",children:e})}function b(e){return C(e)?e.replaceAll(p,e=>g.get(e)??""):e}function w(e){return C(e)?e.split(m).map((e,t)=>{let n=g.get(e);return n?(0,r.jsx)(y,{char:n},t):e}):null}function C(e){return f.test(e)}function N(){return!!i.cg&&"1"===new URL(i.cg.location.href,i.cg.location.origin).searchParams.get("h")}try{v.displayName||(v.displayName="HiddenUnicodeAlert")}catch{}try{x.displayName||(x.displayName="HiddenUnicodeTooltip")}catch{}try{y.displayName||(y.displayName="HiddenUnicodeCharacter")}catch{}},96657:(e,t,n)=>{n.d(t,{o:()=>s});var r=n(70170),i=n(88934),l=n(64830),o=n(88431),a=n(96540);function s(e,t=20){let[n,c]=(0,a.useState)(t),u=(0,a.useRef)(t),d=(0,l.ud)().codeWrappingOption,h=(0,i.zy)();return(0,o.N)(()=>{let n=document.getElementById("file-name-id-wide");if(!n)return;let i=new ResizeObserver((0,r.s)(()=>{let n=document.getElementsByClassName(e)[0]?.firstChild?.getBoundingClientRect().height??t;n>100&&(n=document.getElementsByClassName(e)[0]?.firstChild?.firstChild?.getBoundingClientRect().height),0===n||n===u.current||d.enabled||(c(n),u.current=n)}));return i.observe(n),()=>i.disconnect()},[h.key,d.enabled,e,t]),n}}}]); //# sourceMappingURL=app_assets_modules_react-code-view_utilities_lines_ts-7e9dbbd34eee.js.map